<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .textColor {
      color: red;
    }
    .font{
      font-size: 60px;
    }
  </style>
</head>

<body>
  <script src="./react/react.development.js"></script>
  <script src="./react/react-dom.development.js"></script>
  <script src="./react/babel.min.js"></script>

  <div id="app"></div>

  <script type="text/babel">
    class App extends React.Component {
      constructor(props){
        super(props)
        this.state = {
          active: true
        }
      }
      render(){
        const { active } = this.state
        return (
          <div>
          {/* 核心代码-------- */}
            <div className={'textColor ' + (active ? 'font' : '')}>liwentao</div>
            <div style={{color: 'yellow', fontSize: '100px'}}>liwentao style</div>
          {/* 核心代码-------- */}
          </div>
        )
      }
    }
    ReactDOM.render(<App/>, document.getElementById('app'))
  </script>
</body>

</html>